#!/usr/bin/env ruby

require 'dbi'
require 'singleton'

class Database
    include Singleton    
    attr_reader :connection
    
    def initialize()
        @connection = nil;
    end
    
    def connect(connStr, usr, pwd)
        @connection = DBI.connect(connStr, usr, pwd)
    end
    
    def disconnect
        @connection.close if !@connection.nil?
        @connection = nil
    end
end
